//loop
//load problem
//load all paths for the problem
//convert all to policies
//choose best policy
//save as pathi
fl=[5;1;1;2;2;2;2;1;2;3;2]
gepls=cell();
res=cell();
for i=0:ngen
    [fdg, err] = mopen("gen"+string(i)+".dat");
    gsize=strtod(mgetl(fdg,1));
    grid=mgetl(fdg);
    mclose(fdg);
    for j=0:fl(i+1)-1
        [fdp, err] = mopen("path1_"+string(i)+"_"+string(j)+".dat");
        expert=strtod(mgetl(fdp));
        mclose(fdp);
        gepls(i+1,j+1).entries=zeros(size(expert,1)-2,1);
        for k=2:size(expert,1)-1
            gepls(i+1,j+1).entries(k-1)=expert(k)-expert(k-1);
        end
        res(i+1,j+1).entries=evalr(gepls(i+1,j+1).entries);
    end
end
